/**
 * 作者：陈文斌 on 2019/1/7.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';

class CompanyNamePhoneSection extends StatelessWidget {
  final String companyName;
  final String companyType;
  final String phone;

  CompanyNamePhoneSection({
    Key key,
    this.companyName,
    this.companyType,
    this.phone,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          Container(
            width: AppScreen.setWidth((375 - 17 - 17) ~/ 2),
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                Container(
                  child: Text(
                    companyName ?? '',
                    style: TextStyle(
                      color: AppColors.TextColor,
                      fontSize: AppFontSizes.Font15,
                      fontFamily: AppFontFamilies.PingFangSC,
                      fontWeight: FontWeight.w700,
                    ),
                    maxLines: 1,
                    overflow: TextOverflow.ellipsis,
                  ),
                  constraints: BoxConstraints(
                      maxWidth:
                          AppScreen.setWidth((375 - 17 - 17) ~/ 2 - 30 - 5)),
                ),
                Padding(
                  padding: EdgeInsets.only(right: 5),
                ),
                Image.asset(
                  companyType == '企业'
                      ? 'images/ic_shop_search.png'
                      : 'images/ic_business_search.png',
                  width: 30,
                  height: 16,
                  fit: BoxFit.fill,
                ),
              ],
            ),
          ),
          Container(
            width: AppScreen.setWidth((375 - 17 - 17) ~/ 2),
            child: Row(
              children: <Widget>[
                Expanded(
                  child: Text(
                    phone ?? '',
                    style: TextStyle(color: AppColors.TextColor),
                  ),
                ),
                Container(
                  width: 18,
                  height: 18,
                  decoration: BoxDecoration(
                    color: Color(0xFF00BE98),
                    borderRadius: BorderRadius.circular(9),
                  ),
                  margin: EdgeInsets.only(right: 6),
                ),
                Padding(padding: EdgeInsets.only(right: AppScreen.setWidth(25))),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
